package aftersales

import (
	"context"
	"github.com/google/uuid"
	"github.com/zeromicro/go-zero/core/logx"
	"insighttracking/apps/purchase/internal/svc"
	"insighttracking/apps/purchase/internal/types"
	"net/http"
	"os"
)

type ApiLogic struct {
	logx.Logger
	ctx     context.Context
	svcCtx  *svc.ServiceContext
	Request *http.Request
}

func NewAfterSalesApiLogic(ctx context.Context, svcCtx *svc.ServiceContext, request *http.Request) *ApiLogic {
	hostname, _ := os.Hostname()
	return &ApiLogic{
		Logger: logx.WithContext(ctx).WithCallerSkip(0).WithFields(
			logx.Field("Log_UUID", uuid.New().String()),
			logx.Field("hostname", hostname)),
		ctx:     ctx,
		svcCtx:  svcCtx,
		Request: request,
	}
}

func (l *ApiLogic) CreateTaskApi(req *types.AfterSalesCreateReq) (resp *types.PickingGetTaskResp, err error) {
	resp = &types.PickingGetTaskResp{}
	return
}

func (l *ApiLogic) GetListApi() (resp *types.AftersalesListResp, err error) {
	resp = &types.AftersalesListResp{}
	return
}

func (l *ApiLogic) AllocationApi(req *types.AfterSalesAllocationReq) (resp string, err error) {
	return
}

func (l *ApiLogic) GetStoreListApi(req *types.AftersalesIDForm) (resp *types.PickingGetRecordResp, err error) {
	list := make([]*types.PickingGetRecordList, 0)
	resp = &types.PickingGetRecordResp{
		List:    list,
		SpuName: "",
	}
	return
}
